import request from '@/utils/request'
import Cookies from 'js-cookie'
export function storeList(data) {
    return request({
        url: "/General/get_store",
        method: "post",
        data: data
    })
}
export function houseList(data, type) {
    return request({
        url: "/Stock_check/get_channel",
        method: "post",
        data: data
    })
}
// 列表
export function getList(data, page, type) {
    let url = type == 3 ? '/stock_platform_transfers/platform_transfer_order_list/' + (page ? page : 1) : '/House_transfer/house_transfer_list/' + (page ? page : 1);
    return request({
        url: url,
        method: 'post',
        data: data
    })
}

// 获取分页
export function getPage(data, type) {
    let url = type == 3 ? '/stock_platform_transfers/platform_transfer_order_page' : '/House_transfer/house_transfer_page';
    return request({
        url: url,
        method: 'post',
        data: data
    })
}
//订单详情
export function getinfoList(data,type) {
    let url = type == 3 ? '/stock_platform_transfers/platform_transfer_order_detail' : '/House_transfer/transfer_order_detail';
    return request({
        url: url,
        method: 'post',
        data: data
    })
}

export function getBatchDetail(data,page,type){
    let url = type == 2 ? '/House_transfer/house_transfer_batch_detail/':'/stock_platform_transfers/platform_transfer_batch_detail/' ;
    return request({
        url: url+ (page ? page : 1),
        method: 'post',
        data: data
    })
}
export function getBatchDetailPage(data,type){
    let url = type == 2 ? '/House_transfer/house_transfer_batch_detail_page':'/stock_platform_transfers/platform_transfer_batch_detail_page' ;
    return request({
        url: url,
        method: 'post',
        data: data
    })
}

export function getDetail(data,page,type){
    let url = type == 2 ? '/House_transfer/transfer_order_detail/':'/stock_platform_transfers/platform_transfer_order_detail/';
    return request({
        url: url+ (page ? page : 1),
        method: 'post',
        data: data
    })
}
export function getDetailPage(data,type){
    let url = type == 2 ? '/House_transfer/transfer_order_detail_page':'/stock_platform_transfers/platform_transfer_order_detail_page';
    return request({
        url: url,
        method: 'post',
        data: data
    })
}


// 导出
export function getExport(data) {
    window.location.href = `https://${location.host}/smsi/index.php/house_transfer/get_order_excel?type=${data.type}&order_id=${data.order_id}&didixueshengka=${Cookies.get('SMS_AdminToken')}`;
}





